/**
 * 医生随访表格初始化
 */
var FollowTableList = {
    id: "FollowTableList",	//表格id
    seItem: null,		//选中的条目
    table: null,
    layerIndex: -1
};

/**
 * 初始化表格的列
 */
FollowTableList.initColumn = function () {
    var columns = [
        {title: 'id', field: 'id', visible: false, align: 'center', valign: 'middle'},
        {title: 'customerId', field: 'customerId', visible: false, align: 'center', valign: 'middle'},
        {title: '诊所', field: 'arrivalStore', align: 'center', valign: 'middle', sortable: true},
        {title: '随访时间', field: 'revisitTime', align: 'center', valign: 'middle', sortable: true},
        {title: '随访医生', field: 'doctor', align: 'center', valign: 'middle', sortable: true},
        {title: '随访人员', field: 'doctor', align: 'center', valign: 'middle', sortable: true},
        {title: '咨询师', field: 'fieldTc', align: 'center', valign: 'middle', sortable: true},
        {title: '创建人', field: 'createName', align: 'center', valign: 'middle', sortable: true},
        {title: '随访状态', field: 'revisitStatus', align: 'center', valign: 'middle', sortable: true,
            formatter: function (value, row, index) {
                if (value == 1) {
                    return "待计划";
                } else if (value == 2) {
                    return "回访完成"
                }
            }
        },
        {title: '随访内容', field: 'remarks', align: 'center', valign: 'middle', sortable: true},
        {title: '随访结果', field: 'revisitContent', align: 'center', valign: 'middle', sortable: true}
    ]
    return columns;
};

/**
 * 查询预约客户列表
 */
FollowTableList.search = function () {
    FollowTableList.table.refresh();
};
$(function () {
    var defaultColunms = FollowTableList.initColumn();
    var customerId =$("#customerId").val();
    var reservationsId =$("#reservationsId").val();
    var table = new BSTable(FollowTableList.id,"/doctorLooked/FollowTableList/"+reservationsId, defaultColunms);
    table.setPaginationType("client");//客户端分页
    FollowTableList.table = table.init();
    FollowTableList.search();
});
